<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@ include file="/pub/includ.jsp"%>

<script type="text/javascript">
	
	  
	$(function(){
        loadGird("frm", 1);
	})
		
	var callback_frm = function(rows, frm) {
       $.each(rows, function(i, n){
    	   var row = $("#"+frm+" .template").clone().removeClass("template");
   	       var keyValue = n.id;
	       row.find(".klId").attr("value",n.id);
	   	
	       row.find(".klmodule_id").text(n.module_id);

	       row.find(".kluser_id").text(n.oname);

	       row.find(".kllog_time").text((new Date(n.log_time)).format("yyyy-MM-dd hh:mm:ss"));
	   	
	       row.find(".klwork_ip").text(n.work_ip);
	   	
	       row.find(".klsuccess").text(n.success=="1"?"是":"否");
	   	
	       row.find(".kldescribe").text(n.description);
	   	
	       row.find(".kllog_level").text(n.log_level);
    	   
 		   row.attr("id","ready"+i);
           row.attr("class","tr_nbw");
           row.appendTo("#"+frm+" .grid");
       });   
	}
	
	var deloperatelogs = function(){
		var options = {
		type: 'POST',
		async: false,
		dataType: 'content-type',
		success: function(msg) {
			alert("成功删除"+msg+"条记�?");
			document.location.reload();
		}
		}
		if(confirm('您确认要删除吗？')){
			document.getElementById("frm").action="<%=path%>/sys/operatelog/deloperatelogs";
			$('#frm').ajaxSubmit(options);
		}
	}
</script>
<form name="frm" method="post" style="margin: 0" action="<%=path %>/sys/operatelog/list" id="frm">
		<table width="100%">
			<tr>
				<td height="2px"></td>
			</tr>
			<tr><td align="right">
				<input type="button" onclick="deloperatelogs();" class="button4_nbw" value="删除" />
				&nbsp;&nbsp;
				</td>
			</tr>
		</table>
		<center>
	<table><tr><td height="2px"></td></tr></table>
	<table border="0" cellspacing="1" cellpadding="0" class="table_nbw  niceTable grid">
		<thead class="th_nbw">
			<tr >
				<td width="40px" height="30px">
					<input type="checkbox" class="allCheck" />
				</td>
	      		<td>
					模块
				</td>   
	      		<td>
					操作人
				</td>   
	      		<td>
					操作时间
				</td>   
	      		<td>
					ip
				</td>   
	      		<td>
					是否成功
				</td>   
	      		<td>
					日志描述
				</td>   
	      		<td>
					日志级别
				</td>   
			</tr>
		</thead>
		<tbody>
			<tr class="template klId">
				<td width="40px" class="idCheck">
					<input type="checkbox" name="chk" class="klId" />
				</td>
	   		    <td class="klmodule_id niceTable-left"></td>
	   		    <td class="kluser_id niceTable-left"></td>
	   		    <td class="kllog_time niceTable-left"></td>
	   		    <td class="klwork_ip niceTable-left"></td>
	   		    <td class="klsuccess niceTable-left"></td>
	   		    <td class="kldescribe niceTable-left"></td>
	   		    <td class="kllog_level niceTable-left"></td>
			</tr>
		</tbody>
		<tfoot>
			<tr>
				<td style="border-right: none">
					<img class="loading"
						src="<%=path %>/resources/skins/default/images/large-loading.gif" width="20px"
						class="hidden" />
				</td>
				<td colspan="4" style="border-left: none" class="txtRight">
					<span class="pagediv"></span>
				</td>
			</tr>
		</tfoot>
	</table>
</center>
</form>
